import request from '@/utils/request'

//export表示可以被别人调用
export default {
  //根据课程id获取章节和小节列表
  getChapterVideo(courseId) {
    return request({
      url:`/eduservice/edu-chapter/getChapterVideo/${courseId}`,
      method: 'get'
    })
  },
  //添加章节
  addChapter(chapter) {
    return request({
      url: '/eduservice/edu-chapter/addChapter',
      method: 'post',
      data: chapter
    })
  },
  //根据id查询章节
  getChapter(chapterId) {
    return request({
      url: '/eduservice/edu-chapter/getChapterInfo/'+chapterId,
      method: 'get'
    })
  },
  //修改章节
  updateChapter(chapter) {
    return request({
      url: '/eduservice/edu-chapter/updateChapter',
      method: 'post',
      data: chapter
    })
  },
  //删除章节
  deleteChapter(chapterId) {
    return request({
      url: '/eduservice/edu-chapter/'+chapterId,
      method: 'delete'
    })
  },


}
